<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        function test(event){
            // 事件对象内包含了事件相关的所有信息
            console.log(event);
            // alert(1);
            // 修改文本
            event.target.innerText = '123';
            event.target.onclick = null;
        }
    </script>
</head>
<body>
    <button onclick='test(event)'>按钮</button>
</body>
</html>